package com.syh.jn.scm.service.api.downstream.purchase.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by soci.song on 2018/10/18.
 */
public interface DownPurchaseReturnOrderEnums {

    @Getter
    @AllArgsConstructor
    enum HaveRecord {
        NOT_RECORD(Short.valueOf("0"), "未存在记录","采购退货单"),
        HAVE_RECORD(Short.valueOf("1"), "已存在记录","采购退货单");

        private Short status;
        private String statusName;
        private String statusBelong;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static HaveRecord valueOf(Short status) {
            switch (status) {
                case 0:
                    return NOT_RECORD;
                case 1:
                    return HAVE_RECORD;
            }
            return null;
        }
    }
    @Getter
    @AllArgsConstructor
    enum OrdState {
        STAYCONFIRM(Short.valueOf("0"), "待确认", "采购订单"),
        CONFIRM(Short.valueOf("1"), "已确认", "采购订单"),
        HANG(Short.valueOf("2"), "已挂起", "采购订单"),
        STATEMENT(Short.valueOf("3"), "已生成对账单", "采购订单"),
        CANCEL(Short.valueOf("-1"), "已取消订单", "采购订单");

        private Short status;
        private String statusName;
        private String statusBelong;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static OrdState valueOf(Short status) {
            switch (status) {
                case 0:
                    return STAYCONFIRM;
                case 1:
                    return CONFIRM;
                case 2:
                    return HANG;
                case 3:
                    return STATEMENT;
                case -1:
                    return CANCEL;
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum GeneratedState {
        LOGISTICS_UN_GENERATE(Short.valueOf("0"),"未生成物流"),
        LOGISTICS_PART_GENERATE(Short.valueOf("1"),"部分生成物流"),
        LOGISTICS_WHOLE_GENERATE(Short.valueOf("2"),"全部生成物流");

        private Short status;
        private String statusName;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static GeneratedState valueOf(Short status) {
            switch (status) {
                case 0:
                    return LOGISTICS_UN_GENERATE;
                case 1:
                    return LOGISTICS_PART_GENERATE;
                case 2:
                    return LOGISTICS_WHOLE_GENERATE;
            }
            return null;
        }
    }

    /**
     * 采购单物流状态
     */
    @Getter
    @AllArgsConstructor
    enum DeliveryState {
        LOGISTICS_UN_DELIVERY(Short.valueOf("0"), "未发货", "物流状态"),
        LOGISTICS_PART_DELIVEED(Short.valueOf("1"), "部分发货", "物流状态"),
        LOGISTICS_WHOLE_DELIVEED(Short.valueOf("2"), "全部发货", "物流状态");

        private Short status;
        private String statusName;
        private String statusBelong;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static DeliveryState valueOf(Short status) {
            switch (status) {
                case 0:
                    return LOGISTICS_UN_DELIVERY;
                case 1:
                    return LOGISTICS_PART_DELIVEED;
                case 2:
                    return LOGISTICS_WHOLE_DELIVEED;
            }
            return null;
        }
    }

    @Getter
    @AllArgsConstructor
    public enum CollectState {
        LOGISTICS_UN_COLLECT(Short.valueOf("0"),"未签收"),
        LOGISTICS_PART_COLLECT(Short.valueOf("1"),"部分签收"),
        LOGISTICS_WHOLE_COLLECT(Short.valueOf("2"),"全部签收");

        private Short status;
        private String statusName;

        @Override
        public String toString() {
            return this.status.toString();
        }

        public static CollectState valueOf(Short status) {
            switch (status) {
                case 0:
                    return LOGISTICS_UN_COLLECT;
                case 1:
                    return LOGISTICS_PART_COLLECT;
                case 2:
                    return LOGISTICS_WHOLE_COLLECT;
            }
            return null;
        }
    }
}
